package com.cssy.xxkj.attach.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import com.cssy.xxkj.attach.dao.AttachFileUploadDAO;
import com.cssy.xxkj.attach.entity.AttachFileUploadDO;
import com.cssy.xxkj.attach.service.IAttachFileUploadService;

@Service("attachFileUploadService")
public class AttachFileUploadServiceImpl implements IAttachFileUploadService {

	@Resource(name = "attachFileUploadDAO")
	AttachFileUploadDAO  attachFileUploadDAO;
	
	@Override
	public void save(HttpServletRequest request,MultipartFile file, String projectId,
			String projectType, String fileCategory) {
		this.attachFileUploadDAO.save(request,file,projectId,projectType,fileCategory);
	}
	
	/**
	 * 暂存
	 */
	@Override
	public Map saveTemp(HttpServletRequest request,MultipartFile file, String projectId,
			String projectType, String fileCategory) {
		return this.attachFileUploadDAO.saveTemp(request,file,projectId,projectType,fileCategory);
	}
	
	@Override
	public AttachFileUploadDO findByPrimaryKey(String id){
		return attachFileUploadDAO.findByPrimaryKey(id);
	}
	
	@Override
	public List<AttachFileUploadDO> findFileUploadByIds(List<String> attachIds){
		return attachFileUploadDAO.findFileUploadByIds(attachIds);
	}
	
	@Override
	public List<AttachFileUploadDO> findFileUpDOsByProjectId(String projectId){
		return attachFileUploadDAO.findFileUpDOsByProjectId(projectId);
	}

	@Override
	public List<AttachFileUploadDO> findAttachFileUploadDOs(
			Map<String, String> paramMap) {
		
		return attachFileUploadDAO.findAttachFileUploadDOs(paramMap);
	}
	
	@Override
	public int deleteFileUploadDO(String id){
		return attachFileUploadDAO.deleteFileUpload(id);
	}

	@Override
	public void update(AttachFileUploadDO attachFileUploadDO){
		attachFileUploadDAO.update(attachFileUploadDO);
	}
	
	@Override
	public void updateFileRelated(String idStr,String projectId,String projectType,String fileCategory){
		attachFileUploadDAO.updateFileRelated(idStr,projectId,projectType,fileCategory);
	}
}
